home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / BARNET / FREENET / BRODIE / INTERNET / !InternetD / c / templates < prev    next >
Text File  |  1995-05-16  |  1KB  |  46 lines

  1. /* templates.c */
  2. #include "inetd.h"
  3. #include "templates.h"
  4. #include "oslib:h.wimp"
  5.  
  6. static wimp_w netwalld_w;
  7.  
  8. #define maxsize 320
  9. static char indirected_data[maxsize];
  10.  
  11. void templates_load(void)
  12. {
  13.         char    name[12], *end = indirected_data + maxsize;
  14.         int    used, data_used;
  15.  
  16.     static union {
  17.         wimp_window window;
  18.             wimp_WINDOW(1) window1;
  19.     } w;
  20.  
  21.         strcpy(name, "netwalld");
  22.         wimp_open_template("<InternetD$Dir>.Templates");
  23.         wimp_load_template(&w.window, indirected_data, end, (font_f *)-1, name, 0,
  24.             &used, &data_used);
  25.         wimp_close_template();
  26.         netwalld_w = wimp_create_window(&w.window);
  27. }
  28.  
  29. void template_get_error_box(char *message)
  30. {
  31.         wimp_icon_state    icon_state;
  32.         wimp_window_state    window_state;
  33.  
  34.     icon_state.w = netwalld_w;
  35.     icon_state.i = 0;
  36.         wimp_get_icon_state(&icon_state);
  37.         icon_state.icon.data.indirected_text.text[0] = '\0';
  38.     strncat(icon_state.icon.data.indirected_text.text, message, 160);
  39.         wimp_set_icon_state(netwalld_w, 0, 0, 0);
  40.         window_state.w = netwalld_w;
  41.         wimp_get_window_state(&window_state);
  42.         window_state.next = (wimp_w)-1;
  43.         wimp_open_window((wimp_open *)&window_state);
  44.         os_bell();
  45. }
  46.